package cn.edu.sjtu.literature.enumtype;

public enum UserType {

	ADMINISTRATOR(1), NORMAL(2);
	
	private int id;
	
	private UserType(int id) {
		this.id = id;
	}
	
	public int getId() {
		return id;
	}
	
	public static UserType getUserType(int id) {
		for (UserType type : values()) {
			if (type.id == id)
				return type;
		}
		return NORMAL;
	}
	
}
